package com.dong.cjlibproxy;

public abstract class Handler {
    private Handler successor;

    public Handler getSuccessor() {
        return successor;
    }

    public void setSuccessor(Handler successor) {
        this.successor = successor;
        execute();
    }

    protected abstract  void handleProcess();

    public void execute() {
        handleProcess();
        if(successor!=null) {
            successor.handleProcess();;
        }
    }

}
